package com.crm.miaohe.controller.order.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
import java.util.List;

@Data
public class OrderPlanRequest {
    @Size(min = 1)
    @Valid
    List<ProductInfo> productInfos;

    String fnote;//订单备注
    
    Double checkOrderAmount;

    @Data
    public static class ProductInfo {
        @NotBlank
        private String productCode;

        @NotBlank
        private String materialName;

        private String specCode;
        private String specName;

        @NotNull
        private Integer fqty;
        @NotNull
        private Double price;
        @NotNull
        @DateTimeFormat(pattern = "yyyy-MM-dd")
        @JsonFormat(pattern = "yyyy-MM-dd")
        private Date fDeliveryDate;

        private String taocanDetail;
    }
}
